<?php

    session_start();
    echo "Login: ".$_SESSION["userID"]." ".$_SESSION["userType"];
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

if(isset($_SESSION["userID"]) && !strcmp($_SESSION["userType"], "seller")){
    $saleID =$_GET["saleID"];

    $con = mysql_connect("localhost", "zhouzhao", "19831022");
    if(!$con){
        die("could not connect to DB: ".mysql_error());
    }

    mysql_select_db("cloudcom", $con);

    mysql_query("delete from sales where saleID = $saleID");

    mysql_close($con);

    echo "$saleID";
}else{
    require 'login.html';
}
?>
